#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define MAX 100
int main()
{
    auto int n = 0, x = 0, arr[MAX];
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    scanf("%d", &x);
    for (int i = 0; i < n; i++)
    {
        if (arr[i] != x)
        {
            printf("%d ", arr[i]);
        }
    }
    return 0;
}